'GCV_TOP=1
'GCV_FRONT = 2
'GCV_LEFT = 4
'GCV_RIGHT = 5
'GCV_BOTTOM=0
'GCV_EXTENDED = 7
'GCV_SIMPLIFIED = 8
'GCV_STANDARD = 9
'SIDE = GCV_RIGHT

'DETAIL_LEVEL = GCV_SIMPLIFIED
'24310-80
hatchAngle  = 45                  
'hatchStep=0.5        



'PAR_Dc1 = 6
'PAR_Dc  = 19
'PAR_Dw  = 2

''PAR_AXIS = 0
'++++
SUB LINE (x1,y1,x2,y2,t) Doc.ksLineSEG x1,y1,x2,y2,t END SUB
'++++
SUB DrawRoller (DC1,Dc,H,B, kx,ky)
If PAR_AXIS = 1 Then  
Line 0,H*ky,Dc1*kx,H*ky,1 
Else 
'''''Line Dc1*kx,0,Dc1*kx,H*ky,1
End If


If PAR_AXIS = 1 Then 
Line Dc1*kx,H*ky,(Dc1+B*0.2)*kx,H*ky,1
End If 
If PAR_AXIS = 1 Then 
If DETAIL_LEVEL = GCV_EXTENDED or (DETAIL_LEVEL = GCV_STANDARD and kx=-1)Then 
Line Dc1*kx,0,Dc1*kx,H*ky,1 	
Line (Dc1+B*0.16)*kx,0,(Dc1+B*0.16)*kx,H*ky,1
Line (Dc1+B*0.84)*kx,0,(Dc1+B*0.84)*kx,H*ky,1
End If 
End If 

If PAR_AXIS = 1 Then 
Line Dc*kx,H*ky,(Dc1+B*0.8)*kx,H*ky,1
Line Dc*kx,0,Dc*kx,H*ky,1
End If 



Line (Dc1+B*0.2)*kx,0,(Dc1+B*0.2)*kx,H*ky,1
Line (Dc1+B*0.8)*kx,0,(Dc1+B*0.8)*kx,H*ky,1

Line (Dc1+B*0.2)*kx,H*ky,(Dc1+B*0.25)*kx,2*H*ky,1
Line (Dc1+B*0.8)*kx,H*ky,(Dc1+B*0.75)*kx,2*H*ky,1

If DETAIL_LEVEL = GCV_EXTENDED or (DETAIL_LEVEL = GCV_STANDARD and kx=-1)Then 
  Line (Dc1+B*0.25)*kx,0,(Dc1+B*0.25)*kx,2*H*ky,1
  Line (Dc1+B*0.75)*kx,0,(Dc1+B*0.75)*kx,2*H*ky,1
Else 
'' If PAR_Simpl_AXIS = 1  Then 
   Line (Dc1+B*0.5)*kx,0,(Dc1+B*0.5)*kx,2*H/3*ky,2
   Line (Dc1+B*0.5)*kx-2*H/3,0,(Dc1+B*0.5)*kx+2*H/3,0,2
''  Else 
 ''  Line (Dc1+B*0.25)*kx,0,(Dc1+B*0.25)*kx,2*H*ky,2
 ''  Line (Dc1+B*0.75)*kx,0,(Dc1+B*0.75)*kx,2*H*ky,2
'' End If 
 
End If 
Line (Dc1+B*0.25)*kx,2*H*ky,(Dc1+B*0.75)*kx,2*H*ky,1
End SUB
'++++++++++
Sub Script_OnLoad ()
Dc1 = PAR_Dc1*0.5
Dc  = PAR_Dc*0.5
H   = PAR_Dw*0.25
B   = Dc-Dc1

Select Case DETAIL_LEVEL
       Case GCV_EXTENDED:
doc.ksColouring &HFE000000
Contur DC1,Dc,H,B, 1,1
Contur DC1,Dc,H,B, -1,1
Contur DC1,Dc,H,B, 1,-1
Contur DC1,Dc,H,B, -1,-1
doc.ksEndObj
If PAR_axis = 1 Then 
Doc.kshatch  0, hatchAngle, hatchStep, 0, 0, 0
RolHatch DC1,Dc,H,B, 1,1 
RolHatch DC1,Dc,H,B, 1,-1 
RolHatch DC1,Dc,H,B, -1,1 
RolHatch DC1,Dc,H,B, -1,-1 
Doc.ksEndObj
End If 

 DrawRoller DC1,Dc,H,B, 1,1
 DrawRoller DC1,Dc,H,B, -1,1
 DrawRoller DC1,Dc,H,B,1,-1
 DrawRoller DC1,Dc,H,B,-1,-1
 
      Case  GCV_STANDARD:
 doc.ksColouring &HFE000000
  Contur DC1,Dc,H,B, -1,1
  Contur DC1,Dc,H,B, -1,-1 
 doc.ksEndObj
 
 If PAR_axis = 1 Then
 Doc.kshatch  0, hatchAngle, hatchStep, 0, 0, 0
  RolHatch DC1,Dc,H,B, -1,1 
  RolHatch DC1,Dc,H,B, -1,-1
 Doc.ksEndObj
End If 

 DrawRoller DC1,Dc,H,B, -1,1
 DrawRoller DC1,Dc,H,B, -1,-1     
 
 doc.ksColouring &HFE000000
  Contur DC1,Dc,H,B, 1,1
  Contur DC1,Dc,H,B, 1,-1 
 doc.ksEndObj 
 
 DrawRoller DC1,Dc,H,B, 1,1
 DrawRoller DC1,Dc,H,B, 1,-1     
 
 
      Case  GCV_SIMPLIFIED:
 doc.ksColouring &HFE000000
  Contur DC1,Dc,H,B, -1,1
  Contur DC1,Dc,H,B, -1,-1 
 doc.ksEndObj
 
 doc.ksColouring &HFE000000
  Contur DC1,Dc,H,B, 1,1
  Contur DC1,Dc,H,B, 1,-1 
 doc.ksEndObj     
 
  DrawRoller DC1,Dc,H,B, -1,1
  DrawRoller DC1,Dc,H,B, -1,-1   
  DrawRoller DC1,Dc,H,B, 1,1
  DrawRoller DC1,Dc,H,B, 1,-1   
      
      End Select 
 
If PAR_AXIS =1 Then 
Line -PAR_Dc*0.5-2,0,PAR_Dc*0.5+2,0,3
Line 0,-H-2,0,H+2,3
End If 
End SUB
'+++
Sub Contur (DC1,Dc,H,B, kx,ky)
Line 0,H*ky,Dc1*kx,H*ky,1
Line Dc1*kx,H*ky,(Dc1+B*0.2)*kx,H*ky,1
 If PAR_AXIS = 1 Then 
  Line Dc*kx,H*ky,(Dc1+B*0.8)*kx,H*ky,1
  Line Dc*kx,0,Dc*kx,H*ky,1
  Else 
  Line (Dc1+B*0.8)*kx,0,(Dc1+B*0.8)*kx,H*ky,1
 End If 
Line (Dc1+B*0.2)*kx,H*ky,(Dc1+B*0.25)*kx,2*H*ky,1
Line (Dc1+B*0.8)*kx,H*ky,(Dc1+B*0.75)*kx,2*H*ky,1
Line (Dc1+B*0.25)*kx,2*H*ky,(Dc1+B*0.75)*kx,2*H*ky,1
If DETAIL_LEVEL = GCV_SIMPLIFIED or  DETAIL_LEVEL = GCV_STANDARD Then 
	Line 0,0,0,H*ky,1
End If 

End Sub 
'++++
Sub RolHatch (DC1,Dc,H,B, kx,ky) 
Line Dc1*kx,0,Dc1*kx,H*ky,1 
Line Dc1*kx,H*ky,(Dc1+B*0.16)*kx,H*ky,1
Line (Dc1+B*0.16)*kx,0,(Dc1+B*0.16)*kx,H*ky,1
Line (Dc1+B*0.84)*kx,0,(Dc1+B*0.84)*kx,H*ky,1
Line Dc*kx,H*ky,(Dc1+B*0.84)*kx,H*ky,1
Line Dc*kx,0,Dc*kx,H*ky,1
End Sub 



